All files index.ts

55.56% Statements 20/36
58.82% Branches 20/34
54.55% Functions 6/11
62.96% Lines 17/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x             1x         1x 1x
import * as tf from "@tensorflow/tfjs";
import core from "@cloud-annotations/core";

export default {
  load: async (path: string) => {
    const graphPath = path + "/model.json";
    const labelsPath = path + "/labels.json";
    const graphPromise = tf.loadGraphModel(graphPath);
    const labelsPromise = fetch(labelsPath).then((data) => data.json());
    const [graph, labels] = await Promise.all([graphPromise, labelsPromise]);

    return core._init(tf, graph, labels);
  },
};
E